class SearchPersonDetail {
  Object areaName;
  int departId;
  String departName;
  int iconId;
  int id;
  int jobId;
  String jobName;
  String name;
  bool online;
  Object picId;
  String sn;
  Object workCompany;
  Object workCompanyId;

  //添加的属性
  int updateTime;
  String typeName;

  SearchPersonDetail(
      {this.areaName,
      this.departId,
      this.departName,
      this.iconId,
      this.id,
      this.jobId,
      this.jobName,
      this.name,
      this.online,
      this.picId,
      this.sn,
      this.workCompany,
      this.workCompanyId,
      this.updateTime,
      this.typeName});

  factory SearchPersonDetail.fromJson(Map<String, dynamic> json,String typeName) {
    return SearchPersonDetail(
      areaName: json['areaName'] != null,
      departId: json['departId'],
      departName: json['departName'] ?? "",
      iconId: json['iconId'],
      id: json['id'],
      jobId: json['jobId'],
      jobName: json['jobName'] ?? "",
      name: json['name'] ?? json['carNum'] ?? "",
      online: json['online'],
      picId: json['picId'],
      sn: json['sn'] ?? json['vehicleSn'] ?? "",
      workCompany: json['workCompany'],
      workCompanyId: json['workCompanyId'],
      typeName: typeName
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['departId'] = this.departId;
    data['departName'] = this.departName;
    data['iconId'] = this.iconId;
    data['id'] = this.id;
    data['jobId'] = this.jobId;
    data['jobName'] = this.jobName;
    data['name'] = this.name;
    data['online'] = this.online;
    data['sn'] = this.sn;
//        if (this.areaName != null) {
//            data['areaName'] = this.areaName.toJson();
//        }
//        if (this.picId != null) {
//            data['picId'] = this.picId.toJson();
//        }
//        if (this.workCompany != null) {
//            data['workCompany'] = this.workCompany.toJson();
//        }
//        if (this.workCompanyId != null) {
//            data['workCompanyId'] = this.workCompanyId.toJson();
//        }
    return data;
  }

  @override
  String toString() {
    return '{"id":$id,"name":"$name","sn":"$sn","updateTime":$updateTime}';
  }
}
